import { Injectable } from "@nestjs/common";

@Injectable()
export class BookService {
    private books = [
        {
            id: '1',
            title: '三体',
            author: '张三',
            price: 50
        },
        {
            id: '2',
            title: '爱丽丝',
            author: '里斯',
            price: 10
        },
        {
            id: '3',
            title: '梦',
            author: '里法',
            price: 89
        }
    ]
     findAll() {
        return this.books
    }
    findOne(id:string) {
        return this.books.find(book=>book.id=id)
    }
}